import { useEffect, useState } from "react"
import { Menu } from "../components/chat_sidebar"
import { useLocation } from "react-router-dom"
import { useDispatch, useSelector } from "react-redux";
import { setCurrent } from "../../../store/features/menus";



export const useMenus = () => {

    const { menus } = useSelector((state: any) => state.menus.value)

    const { current } = useSelector((state: any) => state.menus.value);

    const dispatch = useDispatch();


    const onTap = (index: any) => {

        dispatch(setCurrent(index));
    }
    return { menus, current, onTap }
}